#ifndef COLOR_H
#define COLOR_H

class Color
{
public:
	float r, g, b, a;

	Color() : r(0.0f), g(0.0f), b(0.0f), a(0.0f) {};
	Color(float r, float g, float b) : r(r), g(g), b(b), a(0.0f) {};
	Color(float r, float g, float b, float a) : r(r), g(g), b(b), a(a) {};

	inline const Color operator+(const Color& c) const
	{
		return Color(r + c.r, g + c.g, b + c.b, a + c.b);
	}

	inline const Color& operator+=(const Color& c)
	{
		r += c.r; g += c.g; b += c.b;
		return *this;
	}
	
	inline const Color operator-(const Color& c) const
	{
		return Color(r - c.r, g - c.g, b - c.b, a - c.b);
	}
	
	inline const Color& operator-=(const Color& c)
	{
		r -= c.r; g -= c.g; b -= c.b;
		return *this;
	}

	inline const Color operator*(const Color& c) const
	{
		return Color(r * c.r, g * c.g, b * c.b, a * c.b);
	}

	inline const Color& operator*=(const Color& c)
	{
		r *= c.r; g *= c.g; b *= c.b;
		return *this;
	}

	inline const Color operator*(float k) const
	{
		return Color(r * k, g * k, b * k, a * k);
	}

	inline const Color& operator*=(float k)
	{
		r *= k; g *= b; b *= k; a *= k;
		return *this;
	}

	inline const Color operator/(const Color& c) const
	{
		return Color(r / c.r, g / c.g, b / c.b, a / c.b);
	}
	
	inline const Color& operator/=(const Color& c)
	{
		r /= c.r; g /= c.g; b /= c.b;
		return *this;
	}

	static Color white() { return Color(1.0f, 1.0f, 1.0f); };
};

#endif
